<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>我是店铺首页</title>
<!--<link href="../css/usercss.css" rel="stylesheet" type="text/css">-->
<link href="../template/<?=MOBAN?>/css/style.css" rel="stylesheet" type="text/css" />
<link  href="../template/<?=MOBAN?>/css/layout.css" rel="stylesheet" type="text/css" />
<link  href="../template/<?=MOBAN?>/css/comm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/artDialog.js"></script>
<script type="text/javascript" src="../js/jquery.form.js"></script>
</head>
<body>
<?php
$modtag="shopcenter";
include("../template/".MOBAN."/header_user.tpl.php");
?>

<div class='layout_body'>
<div class="opentitle"><h1 class="shopname FLeft"><?=$_SESSION["duoduouser"]?><a href="exit.php">退出</a></h1>
<div class="FRight"><input name="" type="button" class="btn MarginT10" value="设为登录首页" /></div>
</div>
<div class="clears"></div>
<div class="CreatL">
<ul>
<li><a href="mipiao_create.php">创建  米票管理</a></li>
<li><a href="#"> 订单管理</a></li>
<li><a href="#">送米管理</a></li>
<li><a href="#">店铺管理</a></li>

</ul>
</div>
<div class="CreatR">
<dl class="shopindex">
<dt class="shopindexIMG"><img src="../images/shopindexIMG.gif" width="234" height="233" /></dt>
<dd>
<p>店铺简称：未设置  <a href="#" class="ColorRed MarginL10">现在设置</a></p>
<p>店铺编号：<?=$number ?></p>
<p>会员类型：普通会员</p>
<p>店铺认证：
	<?php 
		while($type = mysql_fetch_array($typeRes)){
			if(strpos(" ".$shop_authentication,$type['id'])){
				echo "<span><img src='/umik_u/images/shoptype/{$type['icon']}' /></span>&nbsp;&nbsp;";
			}else{
				echo "<span><img src='/umik_u/images/shoptype/{$type['icon']}' onclick=authconfirm('{$type['id']}','{$type['typename']}','{$type['conditions']}','{$type['license']}') style='filter:gray;'/></span>&nbsp;&nbsp;";
			}
		}
	?>
</p>
</dd>
</dl>
<div class="clears"></div>
<div class="TITline">
<div class="x"></div>
</div>
<div class="clears"></div>
<ul class="shopstat">
<li><h3>店铺状态</h3></li>

<li><em class="FLeft" >可用米</em><div class="FLeft MarginL10" style="background:url('../images/b-1.gif');width:149px; height:44px;font-size:15px;text-align:center;line-height:40px;color:white;"><?=$money*100?></div><div class="clears"></div></li>
<!--<li><em class="FLeft">订单活动冻结米</em><div class="FLeft MarginL10"><img src="../images/stat2.gif" width="149" height="44" /></div><div class="clears"></div></li> -->
<li><em class="FLeft">米票活动冻结米</em><div class="FLeft MarginL10" style="background:url('../images/b-3.gif');width:149px; height:44px;font-size:15px;text-align:center;line-height:40px;color:white;">6000</div><div class="clears"></div></li>
<!--<li><em class="FLeft">累积订单返米</em><div class="FLeft MarginL10"><img src="../images/stat4.gif" width="468" height="44" /></div><div class="clears"></div></li>  -->
<li><em class="FLeft">累积米票返米</em><div class="FLeft MarginL10" style="background:url('../images/b-5.gif');width:149px; height:44px;font-size:15px;text-align:center;line-height:40px;color:black;">2000</div><div class="clears"></div></li>
<li><em class="FLeft"></em>
<div class="FLeft MarginL10" style="background:url('../images/b-5.gif');width:149px; height:44px;font-size:15px;text-align:center;line-height:40px;color:black;">6笔</div>
<div class="FLeft MarginL10" style="background:url('../images/b-5.gif');width:149px; height:44px;font-size:15px;text-align:center;line-height:40px;color:black;">5人</div><div class="clears"></div></li>
</ul>


<ul class="shopstat_tag" style="display:none;">
<li class="tit"><img src="../images/shopIndexbox_tit.gif" width="211" height="18" /></li>
<li>这里是您的店标，请立刻设置！</li>
<li><input name="" type="button" value="现在修改" class="but"></li>
</ul>

<ul class="shopstat_tag MarginL10" style="display:none;">
<li class="tit"><img src="../images/shopIndexbox_tit.gif" width="211" height="18" /></li>
<li>实体</li>
<li>您将得到唯一的实体认证图标，更直
观的展示方式！</li>
</ul>
<div id="layer_confirm" style="display:none;">
	<ul  class="shopstat_tag MarginL10" >
	<li class="tit"><img src="../images/shopIndexbox_tit.gif" width="211" height="18" /></li>
	<li>您要申请认证"<span id="confirm_text"></span>"吗？</li>
	<li><input id="confirm_button" type="button" value="现在修改" class="but" onclick="showmessage()"></li>
	</ul>
</div>

</div>
<div class="clears"></div>

<!-- 浮层 -->
<div style="display:none;" id="layer_message" >
	<div class="Message" style="height:250px;" >
	<form id="layer_form" method="POST" action="center.php?type=ajax" enctype="multipart/form-data">
		<table width="100%" border="0" cellspacing="5" cellpadding="5">
		  <tr>
		  	<input type="hidden" id="ajax_type"  value="ajax">
			<input type="hidden" id="authtype"  name="authtype">
		  </tr>
		  <tr id="conditions_layer">
			  <td id="conditions_title"></td>
			  <td><input id="conditions" name="conditions" type="text" class="txt" ></td>
		  </tr>
		  <tr id="licenes_layer">
			  <td id="license_title"></td>
			  <td><input id="pic" name="license" type="file" value="" class="txt" onchange="PreviewImage('Preview',this,100,100);"></td>
		  </tr>
		  <tr>
		  	<td></td>
		  	<td height="100"><div id="Preview" style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);"></div></td>
		  </tr>
		  <tr>
		  	<td></td>
		  	<td align="right">
			  	<input name="" type="button" value="暂时不申请" class="but" onclick="artdialogclose()">
			  	<input name="" type="button" value="现在申请" class="but" onclick="ajaxApply();">
		  	</td>
		  </tr>
		</table>
	</form>
	</div>
</div>
<div id="layer_succ" style="display:none;">
	<ul  class="shopstat_tag MarginL10" >
		<li class="tit">&nbsp;</li>
		<li style="test-align:center;float:left;position:relative;MARGIN-RIGHT:auto;MARGIN-LEFT:auto;left:10%;"">您的申请已提交，请等待认证！</li>
		<li style="test-align:center;float:left;position:relative;MARGIN-RIGHT:auto;MARGIN-LEFT:auto;left:32%;">
			<input  type="button" value="确定" class="but" onclick="artdialogclose()">
		</li>
	</ul>
</div>
<!-- 浮层 -->


</div>
<div class="lineclear"></div>
<?php
include("../template/".MOBAN."/footer.tpl.php");
?>
<script>  

/*
$(function(){
	var Browser_Agent = navigator.userAgent;//判断浏览器的类型
	//if (Browser_Agent.indexOf("Firefox") != -1) {//火狐浏览器
	//alert(Browser_Agent.indexOf("Firefox"))
	alert(Browser_Agent)
});
*/
function artdialogclose(){
	var list = art.dialog.list;
	for (var i in list) {
	    list[i].close();
	};
}

function authconfirm(id,typename,conditions,license){
	//console.log(conditions);
	//console.log(license);
	$("#confirm_text").text(typename);
	$("#authtype").val(id);
	if(conditions){
		$("#conditions_layer").css("display","block");
		$("#conditions_title").html(conditions);
	}
	if(license){
		$("#license_layer").css("display","block");
		$("#license_title").html(license);
	}
	art.dialog({
		title:'',
		id:'authconfirm',
		left:'70%',
		top:"56%",
		content: $("#layer_confirm").html(),
		padding: 0,
		//background: '#FFF', // 背景色
		opacity: 0.87
		});
	$(".aui_close").hide();
}

function showmessage(){
	art.dialog.list['authconfirm'].close();
	art.dialog({
		title:'',
		id:'showmessage',
		left:'70%',
		top:"56%",
		content: $("#layer_message").html(),
		padding: 0,
		opacity: 0.87
		});
	$(".aui_close").hide();
}

function ajaxApply(){
	$("#layer_form").ajaxSubmit({
		success:function(s){
			if(s == "succ"){
				art.dialog.list['showmessage'].close();
				art.dialog({
					title:'',
					id:'result',
				    content: $('#layer_succ').html(),
				    padding: 0,
				    top:"50%",
					opacity: 0.87
				});
				$(".aui_close").hide();
			}
		}
	});
}

function checkPic() {
	var picPath = document.getElementById("pic").value;
	var type = picPath.substring(picPath.lastIndexOf(".") + 1, picPath.length).toLowerCase();
	if (type != "jpg" && type != "bmp" && type != "gif" && type != "png") {
		alert("请上传正确的图片格式");
		return false;
	}
	return true;
}

//图片预览
function PreviewImage(divImage, upload, width, height) {
	if (checkPic()) {
		try {
			var imgPath;      //图片路径
			var Browser_Agent = navigator.userAgent;//判断浏览器的类型
				if (Browser_Agent.indexOf("Firefox") != -1) {//火狐浏览器		
				document.getElementById(divImage).innerHTML ="";
				document.getElementById(divImage).innerHTML = "<img id='imgPreview'  width='" + width + "' height='" + height + "'/>";
				var imgObjPreview=document.getElementById("imgPreview");
				imgObjPreview.src = window.URL.createObjectURL(upload.files[0]);
			} else { //IE浏览器 ie9 必须在兼容模式下才能显示预览图片
				var Preview = document.getElementById(divImage);
				document.getElementById(divImage).innerHTML ="";
				Preview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = upload.value;
				Preview.style.width = width;
				Preview.style.height = height;
			}
		} catch (e) {
			alert("请上传正确的图片格式");
		}
	}
}
</script>
</body>
</html>